package com.cadre.system;

import com.alibaba.fastjson.JSONArray;

import java.util.HashMap;
import java.util.Map;

/* loaded from: ZhiwuStringBuild.class */
public class ZhiwuStringBuild extends SQLStringBuild {
    private Map<String, String> basemap;

    @Override // com.tdqy.cadre.modular.profess.common.SQLStringBuild
    public String builder(Map<String, Object> map) {
        initMap();
        StringBuilder sqlbuilder = new StringBuilder();
        JSONArray valuestring = (JSONArray) map.get("valueString");
        for (int i = 0; i < valuestring.size(); i++) {
            if (valuestring.get(i).equals("领导职务兼任一级巡视员")) {
                sqlbuilder.append(" select d.personid from d_persontag d where d.tagid = 50 AND d.valuestring = '领导职务' \r\n intersect select d.personid from d_persontag d where d.tagid = 50 and d.valuestring = '一级巡视员'");
            } else if (valuestring.get(i).equals("领导职务兼任二级巡视员")) {
                sqlbuilder.append(" select d.personid from d_persontag d where d.tagid = 50 AND d.valuestring = '领导职务' \r\n intersect select d.personid from d_persontag d where d.tagid = 50 and d.valuestring = '二级巡视员'");
            } else {
                sqlbuilder.append("select d.personid from d_persontag d where d.tagid = 50 AND d.valuestring = ").append(this.basemap.get(valuestring.get(i)));
            }
        }
        return sqlbuilder.toString();
    }

    private void initMap() {
        this.basemap = new HashMap();
        this.basemap.put("领导职务兼任职级", "'一级巡视员','二级巡视员','一级调研员','二级调研员','三级级调研员','四级级调研员','一级主任科员','二级主任科员','三级主任科员','四级主任科员','一级科员','二级科员'");
        this.basemap.put("一级巡视员", "'一级巡视员'");
        this.basemap.put("二级巡视员", "'二级巡视员'");
        this.basemap.put("领导职务", "'领导职务'");
    }
}
